import setting from '@/setting';
import { UseEnum, LabelEnum, ApplyEnum } from './enum'

export const USEING_STATE_OPTIONS = UseEnum.options // 启用状态下拉集合
export const LABEL_TYPE_OPTIONS = LabelEnum.options // 标签类型下拉集合
export const APPLY_TYPE_OPTIONS = ApplyEnum.options // 打标类型下拉集合

export const APPLY_TYPE_VALUES = ApplyEnum.values // 打标类型枚举值

export const FORM_ITEMS = [
  {
    prop: 'labelName',
    label: '标签名称',
    type: 'input'
  },
  {
    prop: 'state',
    label: '启用状态',
    type: 'select',
    options: USEING_STATE_OPTIONS,
    clearable: true
  }
]

export const TABLE_COLUMNS = [
  {
    title: '标签名称',
    key: 'labelName'
  },
  {
    title: '标签类型',
    key: 'labelTypeStr'
  },
  {
    title: '图标',
    notShowTip: true,
    render: (h, { row }) => row.nameImg
      ? <img
        src={`${setting.IMAGEURL}${row.nameImg}?${setting.XOSSPROCE}`}
        style={ 'height: 50px' }
        alt=""
      />
      : <span></span>
  },
  {
    title: '标签介绍',
    key: 'note'
  },
  {
    title: '创建时间',
    key: 'createTime'
  },
  {
    title: '创建人',
    key: 'createOperName'
  },
  {
    title: '启用状态',
    key: 'stateStr'
  }
]
